let moment = require('moment');
moment.locale('zh-cn');
exports.fromNow = (date)=>moment(date).fromNow();
exports.toFromNow = (items,key)=> items.forEach(item=>item[key] = exports.fromNow(item[key]));;

exports.money = function(val){
   let language = this.ctx.get('accept-language');
   if(language.includes('zh-cn')){
      return '￥'+val;
   }else{
      return '$'+val;
   }
}